<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport"
        content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>高压氧空气消毒记录表单</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../css/style.css" />
    <link rel="stylesheet" type="text/css" href="../css/aui.2.0.css" />
    <style>
        .form-container {
            width: 100%;
            padding-top: 20px;
        }

        .form-container>h2 {
            margin: 0 auto;
            width: 500px;
            text-align: center;
        }

        .form-container>.form-wrapper {
            display: -webkit-flex;
            display: flex;
            justify-content: flex-start;
            flex-wrap: wrap;
            padding-top: 20px;
        }

        .form-container>.form-wrapper>div {
            width: 50%;
            margin-top: 10px;
        }

        .form-container>.form-wrapper>div>span {
            vertical-align: middle;
        }

        .form-container>.form-wrapper>div>span:nth-child(1) {
            display: inline-block;
            width: 30%;
            height: 30px;
            font-size: 14px;
            text-align: center;
        }

        .form-container>.form-wrapper>div>input {
            display: inline-block;
            width: 70%;
            height: 25px !important;
            font-size: 14px;
            text-align: center;
            vertical-align: middle;
            overflow: hidden;
            border: 1px solid rgba(0, 0, 0, 0.3);
        }

        .aui-form-list-wrapper,
        .aui-form-list-info-wrapper {
            display: flex;
            display: -webkit-flex;
            justify-content: flex-start;
            flex-wrap: wrap;
            margin: 10px 0;
        }

        .aui-form-list-wrapper>li {
            width: 33.33%;
        }

        .aui-form-list-wrapper-content {
            width: 100%;
            display: flex;
            display: -webkit-flex;
            justify-content: flex-start;
            flex-wrap: wrap;
            margin: 10px 0;
        }

        .header {
            text-align: center;
        }

        .aui-form-list-wrapper-content>li {
            width: 50%;
        }

        .aui-list-item-label {
            width: 100% !important;
        }

        .form-submit {
            width: 100%;
            text-align: center;
            margin-top: 50px;
        }

        .form-submit>button {
            width: 170px;
            height: 50px;
            text-align: center;
            background-color: #0064B0;
            color: #fff;
            padding-bottom: 10px;
            font-size: 20px;
        }

        .aui-list-item-input {
            color: #666 !important;
        }

        .aui-list-item-label,
        .aui-list-item-input,
        input[type="text"] {
            font-size: 0.6rem;
        }

        .textarea-container {
            width: 100%;
            margin: 0 auto;
        }

        .textarea-wrapper {
            min-height: 100px;
            border: 1px solid rgba(0, 0, 0, 0.3);
            width: 97%;
            margin: 20px auto 5px auto;
            border-radius: 5px;
        }
    </style>
</head>

<body>
    <main id="app">
        <div class="form-container">
            <div class="aui-content aui-margin-b-15">
                <ul class="aui-list aui-form-list aui-form-list-wrapper-content">
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label aui-list-item-input">
                                签名:
                            </div>
                            <div class="aui-list-item-input">
                                <input type="text" id="adAutograph" placeholder="请填写签名">
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label aui-list-item-input">
                                日期：
                            </div>
                            <div class="aui-list-item-input" id="adOperTime" onclick="getDateTime()">
                                {{getDateTime}}
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label aui-list-item-input">
                                1号消毒时间:
                            </div>
                            <div class="aui-list-item-input" id="adTimeOne" onclick="getTime()">
                                {{getTime}}
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">
                                1号累计时间：
                            </div>
                            <div class="aui-list-item-label aui-list-item-input">
                                <input type="text" id="adCumulativeTimeOne" placeholder="累计时间">
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label aui-list-item-input">
                                2号消毒时间:
                            </div>
                            <div class="aui-list-item-input" id="adTimeTwo" onclick="getTimes()">
                                {{getTimes}}
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label aui-list-item-input">
                                2号累计时间：
                            </div>
                            <div class="aui-list-item-label aui-list-item-input">
                                <input type="text" id="adCumulativeTimeTwo" placeholder="累计时间">
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label aui-list-item-input">
                                3号消毒时间:
                            </div>
                            <div class="aui-list-item-input" id="adTimeThree" onclick="getTimess()">
                                {{getTimess}}
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label aui-list-item-input">
                                3号累计时间：
                            </div>
                            <div class="aui-list-item-label aui-list-item-input">
                                <input type="text" id="adCumulativeTimeThree" placeholder="累计时间">
                            </div>
                        </div>
                    </li>
                </ul>
            </div>
        </div>
        <div>
            <div class="header">
                舱室
            </div>
            <div class="aui-content aui-margin-b-15">
                <ul class="aui-list aui-form-list aui-form-list-wrapper-content">
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label aui-list-item-input">
                                一号（抢救舱）：
                            </div>
                            <div class="aui-list-item-input">
                                <!-- <input type="text" placeholder="通风"> -->
                                <input class="aui-checkbox" value="一号（抢救舱）" type="checkbox" name="adCabin" checked>
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label aui-list-item-input">
                                二号（治疗舱）：
                            </div>
                            <div class="aui-list-item-input">
                                <input class="aui-checkbox" value="二号（治疗舱）" type="checkbox" name="adCabin" checked>
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label aui-list-item-input">
                                三号（过渡舱）：
                            </div>
                            <div class="aui-list-item-input">
                                <!-- <input type="text" placeholder="舱壁"> -->
                                <input class="aui-checkbox" value="三号（过渡舱）" type="checkbox" name="adCabin" checked>
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label aui-list-item-input">
                                抢救室：
                            </div>
                            <div class="aui-list-item-input">
                                <input class="aui-checkbox" value="抢救室" type="checkbox" name="adCabin" checked>
                            </div>
                        </div>
                    </li>
                </ul>
            </div>
        </div>
        <div>
            <div class="header">
                消毒位置
            </div>
            <div class="aui-content aui-margin-b-15">
                <ul class="aui-list aui-form-list aui-form-list-wrapper-content">
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label aui-list-item-input">
                                紫外线灯：
                            </div>
                            <div class="aui-list-item-input">
                                <!-- <input type="text" placeholder="通风"> -->
                                <input class="aui-checkbox" type="checkbox" name="adRescueRoom" value="1" checked
                                    id="adRescueRoom">
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label aui-list-item-input">
                                空气消毒机：
                            </div>
                            <div class="aui-list-item-input">
                                <!-- <input type="text" placeholder="地面"> -->
                                <input class="aui-checkbox" type="checkbox" name="adHallOne" value="1" checked
                                    id="adHallOne">
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label aui-list-item-input">
                                含氯消毒液500mg/L：
                            </div>
                            <div class="aui-list-item-input">
                                <!-- <input type="text" placeholder="舱壁"> -->
                                <input class="aui-checkbox" type="checkbox" name="adHallTwo" value="1" checked
                                    id="adHallTwo">
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label aui-list-item-input">
                                含氯消毒液1000mg/L：
                            </div>
                            <div class="aui-list-item-input">
                                <!-- <input type="text" placeholder="台面"> -->
                                <input class="aui-checkbox" type="checkbox" name="adHallThree" value="1" checked
                                    id="adHallThree">
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label aui-list-item-input">
                                含氯消毒液1500mg/L：
                            </div>
                            <div class="aui-list-item-input">
                                <!-- <input type="text" placeholder="台面"> -->
                                <input class="aui-checkbox" type="checkbox" name="adHallFour" value="1" checked
                                    id="adHallFour">
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label aui-list-item-input">
                                含氯消毒液2000mg/L：
                            </div>
                            <div class="aui-list-item-input">
                                <!-- <input type="text" placeholder="台面"> -->
                                <input class="aui-checkbox" type="checkbox" name="adMgl" value="1" checked id="adMgl">
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label aui-list-item-input">
                                通风：
                            </div>
                            <div class="aui-list-item-input">
                                <!-- <input type="text" placeholder="台面"> -->
                                <input class="aui-checkbox" type="checkbox" name="adCirculation" value="1" checked id="adCirculation">
                            </div>
                        </div>
                    </li>
                </ul>
            </div>
        </div>
        <div class="textarea-container">
            <div>其他</div>
            <div contenteditable="true" class="textarea-wrapper" id="adOther">
            </div>
        </div>
        <div class="form-submit">
            <button onclick="insertHoAirDisinfection()">提交</button>
        </div>
    </main>
</body>

</html>

<script src="../script/api.js" charset="utf-8" type="text/javascript"></script>
<script src="../script/vue.js" charset="utf-8" type="text/javascript"></script>
<script src="../js/jquery.min.js" charset="utf-8" type="text/javascript"></script>
<script src="../js/ToConfigure.js" charset="utf-8" type="text/javascript"></script>
<script src="../script/aui-toast.js" charset="utf-8" type="text/javascript"></script>
<script src="../script/aui-dialog.js" charset="utf-8" type="text/javascript"></script>
<script src="../script/aui-tab.js" charset="utf-8" type="text/javascript"></script>
<script type="text/javascript">
    var vm;
    apiready = function () {
        vm = new Vue({
            el: '#app',
            data: {
                Query_UserList: [], //舱室操舱人员信息
                getDateTime: '时间',
                getTime: '选择时间',
                getTimes: '选择时间',
                getTimess: '选择时间',
                getTimeing:'选择时间'
                
            },
            created() {

            },
            watch: {
                searchInfo: function () { }
            },
            methods: {

            },
        })
    }
    // //选择时间
    // function getDateTime() {
    //     let _this = this;
    //     api.openPicker({
    //         type: 'date',
    //         title: '选择开始日期'
    //     }, function (ret, err) {
    //         if (ret) {
    //             var month = ret.month > 9 ? ret.month : '0' + ret.month;
    //             var day = ret.day > 9 ? ret.day : '0' + ret.day;
    //             vm.getDateTime = '' + ret.year +
    //                 '-' + month +
    //                 '-' + day
    //         }
    //     });
    // }


    function getTime() {
        api.openPicker({
            type: 'time',
            date: '08:30',
            title: '选择升压时间'
        }, function (ret, err) {
            if (ret) {
                vm.getTime = ret.hour +
                    ':' + ret.minute + ':00';
                console.log(ret.minute);
            }
        });
    }

    function getTimes() {
        api.openPicker({
            type: 'time',
            date: '08:30',
            title: '选择升压时间'
        }, function (ret, err) {
            if (ret) {
                vm.getTimes = ret.hour +
                    ':' + ret.minute + ':00';
                console.log(ret.minute);
            }
        });
    }

    function getTimess() {
        api.openPicker({
            type: 'time',
            date: '08:30',
            title: '选择升压时间'
        }, function (ret, err) {
            if (ret) {
                vm.getTimess = ret.hour +
                    ':' + ret.minute + ':00';
                console.log(ret.minute);
            }
        });
    }


    function closewin() {
        api.closeWin({
            name: 'disinfection-record-form'
        });
    }


    /**
     * 添加空气消毒登记表
     */
    function insertHoAirDisinfection() {
        //定义toast提示框
        var toast = new auiToast();
        //获取所属医院IP地址
        var Url_IP = ToConfigure_IP("Gorgeous");
        /**
         * 获取参数
         */
        var jsonStr = parameter();
        /**
         * 验证参数是否为空
         */
        if (jsonStr) {
            /**
             * 请求控制器
             */
            $.ajax({
                url: Url_IP + '/disinfectioninspection/hoairdisinfection/insertHoAirDisinfection',
                type: 'post',
                contentType: "application/json",
                dataType: "json",
                data: jsonStr,
                success: function (result) {
                    /**
                     * 验证是否成功
                     */
                    if (result.success == true) {

                        /**
                         * 操作成功提醒
                         */
                        JumpPage();
                    } else {
                        /**
                         *  提示错误信息
                         */
                        toast.fail({
                            title: "添加失败",
                            duration: 2000
                        });
                    }
                },
                error: function (result) {
                    /**
                     *  提示错误信息
                     */
                    toast.fail({
                        title: "添加失败",
                        duration: 2000
                    });
                }
            });
        }
    }


    //跳转页面
    function JumpPage() {
        var dialog = new auiDialog();
        dialog.alert({
            title: "提示",
            msg: '操作成功，是否跳转空气消毒记录单',
            buttons: ['取消', '确定']
        }, function (ret) {
            if (ret.buttonIndex === 1) {

            } else if (ret.buttonIndex === 2) {
                api.openWin({
                    name: 'HO_AirDisinfection-header',
                    url: './HO_AirDisinfection-header.html',
                    pageParam: {}
                });
            }
        })
    }


    /**
     * 获取参数信息
     * @param type
     * @returns {string}
     */
    function parameter() {
        var jsParms = new Object();
        /**
         * 日期
         */
        jsParms.adOperTime = $("#adOperTime").text();
        /**
          * 涓€鍙锋秷姣掓椂闂�
          */
        jsParms.adTimeOne = $("#adTimeOne").text();
        /**
         * 涓€鍙风疮璁℃椂闂�
         */
        jsParms.adCumulativeTimeOne = $("#adCumulativeTimeOne").val();
        /**
         * 浜屽彿娑堟瘨鏃堕棿
         */
        jsParms.adTimeTwo = $("#adTimeTwo").text();
        /**
         * 浜屽彿绱鏃堕棿
         */
        jsParms.adCumulativeTimeTwo = $("#adCumulativeTimeTwo").val();
        /**
         * 涓夊彿娑堟瘨鏃堕棿
         */
        jsParms.adTimeThree = $("#adTimeThree").text();
        /**
         * 涓夊彿绱鏃堕棿
         */
        jsParms.adCumulativeTimeThree = $("#adCumulativeTimeThree").val();
        /**
         * 累计时间
         */
        jsParms.adCumulativeTime = $("#adCumulativeTime").val();
        /**
         * 签名
         */
        jsParms.adAutograph = api.pageParam["userName"];
        /**
         * 操作人
         */
        jsParms.adOperator = $("#adOperator").val();
        /**
         * 舱室
         */
        var adCabin = [];
        $('input[name=adCabin]:checked').each(function () {
            /**
             * 最加数组
             */
            adCabin.push($(this).val());
        });
        /**
         * 数组转换成字符串
         */
        jsParms.adCabin = adCabin.join(',');

        /**
         * 紫外线灯（抢救室）  单选按钮选中的话给周赋值
         */
        $('input[name=adRescueRoom]:checked').each(function () {
            jsParms.adRescueRoom = $(this).val();
        });
        if (jsParms.adRescueRoom == null || jsParms.adRescueRoom == undefined) {
            jsParms.adRescueRoom = 0;
        }

        /**
         * 紫外线灯（消毒室）  单选按钮选中的话给周赋值
         */
        $('input[name=adDisinfecRoom]:checked').each(function () {
            jsParms.adDisinfecRoom = $(this).val();
        });
        if (jsParms.adDisinfecRoom == null || jsParms.adDisinfecRoom == undefined) {
            jsParms.adDisinfecRoom = 0;
        }
        /**
         * 动态空气消毒机（大厅1号）   单选按钮选中的话给周赋值
         */
        $('input[name=adHallOne]:checked').each(function () {
            jsParms.adHallOne = $(this).val();
        });
        if (jsParms.adHallOne == null || jsParms.adHallOne == undefined) {
            jsParms.adHallOne = 0;
        }
        /**
         * 动态空气消毒机（大厅2号）   单选按钮选中的话给周赋值
         */
        $('input[name=adHallTwo]:checked').each(function () {
            jsParms.adHallTwo = $(this).val();
        });
        if (jsParms.adHallTwo == null || jsParms.adHallTwo == undefined) {
            jsParms.adHallTwo = 0;
        }
        /**
         * 动态空气消毒机（大厅3号）   单选按钮选中的话给周赋值
         */
        $('input[name=adHallThree]:checked').each(function () {
            jsParms.adHallThree = $(this).val();
        });
        if (jsParms.adHallThree == null || jsParms.adHallThree == undefined) {
            jsParms.adHallThree = 0;
        }
        /**
         * 动态空气消毒机（大厅4号）   单选按钮选中的话给周赋值
         */
        $('input[name=adHallFour]:checked').each(function () {
            jsParms.adHallFour = $(this).val();
        });
        if (jsParms.adHallFour == null || jsParms.adHallFour == undefined) {
            jsParms.adHallFour = 0;
        }
        /**
         * 2000mg/L   单选按钮选中的话给周赋值
         */
        $('input[name=adMgl]:checked').each(function () {
            jsParms.adMgl = $(this).val();
        });
        if (jsParms.adMgl == null || jsParms.adMgl == undefined) {
            jsParms.adMgl = 0;
        }
         /**
         *通风
         */
         $('input[name=adCirculation]:checked').each(function () {
            jsParms.adCirculation = $(this).val();
        });
        if (jsParms.adCirculation == null || jsParms.adCirculation == undefined) {
            jsParms.adCirculation = 0;
        }
        /**
         * 签名
         */
        jsParms.adOther = $("#adOther").text();
        /**
         * 转成json数据
         */
        return JSON.stringify(jsParms);
    }


    function getTimeing() {
        api.openPicker({
            type: 'time',
            title: '请选择时间'
        }, function (ret1, err1) {
            if (ret1) {
                vm.getTime = '' + ret1.hour + ':' + ret1.minute + ':00'
            }
        });
    }

    function getDateTime() {
        api.openPicker({
            type: 'date_time',
            title: '选择开始日期'
        }, function (ret, err) {
            if (ret) {
                var year = ret.year;
                var month = ret.month;
                var day = ret.day;
                vm.getDateTime = '' + year +
                    '-' + month +
                    '-' + day
            }
        });
    }
</script>